﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace Warehouse.Read.API.Controllers
{
    public class CusException : IExceptionFilter
    {
        ILogger<CusException> _logger;
        public CusException(ILogger<CusException> logger)
        {
            _logger = logger;
        }

        public void OnException(ExceptionContext context)
        {
            _logger.LogError("【全局异常管理器】" + context.Exception.Message);
            context.ExceptionHandled = true;
        }
    }
}
